package org.pupil.invoke;

import org.pupil.socket.codec.RpcRequest;

/**
 * @Description: 代理调用目标方法信息，将接收到的请求信息转换成该消息用处理
 * @Author: pupil
 * @Date: 2024/07/09 下午 6:14
 */
public class Invocation {

    private String serviceVersion; // 服务版本
    private String className; // 类名
    private String methodName; // 方法名
    private Integer methodCode; // 方法的hashCode
    private Object[] parameter; // 方法参数
    private Class<?>[] parameterTypes; // 方法参数类型


    public Invocation(RpcRequest request) {
        this.serviceVersion = request.getServiceVersion();
        this.className = request.getClassName();
        this.methodName = request.getMethodName();
        this.methodCode = request.getMethodCode();
        this.parameter = request.getParameter();
        this.parameterTypes = request.getParameterTypes();
    }

    public String getServiceVersion() {
        return serviceVersion;
    }

    public void setServiceVersion(String serviceVersion) {
        this.serviceVersion = serviceVersion;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Integer getMethodCode() {
        return methodCode;
    }

    public void setMethodCode(Integer methodCode) {
        this.methodCode = methodCode;
    }

    public Object[] getParameter() {
        return parameter;
    }

    public void setParameter(Object[] parameter) {
        this.parameter = parameter;
    }

    public Class<?>[] getParameterTypes() {
        return parameterTypes;
    }

    public void setParameterTypes(Class<?>[] parameterTypes) {
        this.parameterTypes = parameterTypes;
    }
}
